package com.hsoft.zhxy.app.layout_03_01.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hsoft.zhxy.app.common.model.entity.JcqxGnzy;
import com.hsoft.zhxy.app.layout_03_01.model.vo.LoginVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * All rights Reserved, Designed By 哈尔滨工业大学软件工程股份有限公司
 *
 * @Title: 登录操作 DAO层接口
 * @Package
 * @Description:
 * @author: system
 * @date: 2020-10-23
 */
@Mapper
@Repository
public interface LoginMapper {

    @Select("select * from jcqx_yh yh " +
            " ${ew.customSqlSegment} ")
    LoginVO getUserInfo(@Param("ew") QueryWrapper<LoginVO> queryWrapper);


    @Select("select gnzy.gnzymc, gnzy.qqlj,gnzy.gnzyid, gnzy.fcdid, gnzy.gnzymc, gnzy.sfwym,gnzy.dblxbs, gnzy.dbssxyybs, gnzy.zymchz\n" +
            "from jcqx_yh yh\n" +
            "left join jcqx_yhjs yhjs on yh.yhid = yhjs.yhid\n" +
            "left join jcqx_jszy jszy on yhjs.jsid = jszy.jsid\n" +
            "left join jcqx_gnzy gnzy on jszy.gnzyid = gnzy.gnzyid\n" +
            "where yh.yhid = #{yhid}  and gnzy.gnzyid is not null and gnzy.sfpdqx = 1\n" +
            "order by pxh ")
    List<JcqxGnzy> findListGnzyAll(@Param("yhid") String yhid);
}
